package com.pikaqiu.warehouse.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pikaqiu.warehouse.domain.entity.Company;
import lombok.Data;

import java.util.Date;

/**
 * @Author: Administrator
 * @Date: 2024/8/15
 */
@Data
public class HomeIndexDto {

    private Integer companyId;

    private String userName;

    private String companyName;

    private String companyImage;

    private String roleName;

    private Integer userNum;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date registerDate;

    public HomeIndexDto(Company company, String userName, String roleName, int userNum) {
        this.companyId = company.getId();
        this.companyName = company.getCompanyName();
        this.registerDate = company.getRegisterDate();
        this.companyImage = company.getImage();
        this.userName = userName;
        this.roleName = roleName;
        this.userNum = userNum;
    }
}
